package com.gin.kotlin.no_gay_alliance.database.dao

import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import androidx.room.Update
import com.gin.kotlin.no_gay_alliance.database.entity.ReplyHistoryTopic

@Dao
interface ReplyHistoryTopicDao {
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun add(topic: ReplyHistoryTopic)

    @Update
    fun update(list:List<ReplyHistoryTopic>)

    @Delete
    fun del(topic: ReplyHistoryTopic)

    @Query("delete from ReplyHistoryTopic where topicId=:topicId")
    fun del(topicId: Long)

    @Query("select * from ReplyHistoryTopic")
    fun list(): List<ReplyHistoryTopic>?
}